package com.wzh.demo;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @description:
 * @author: WZH
 * @time: 2021/5/24 10:40
 */
public class Demo1 {

    public static void main(String[] args) {

        HashMap<Integer, BigDecimal> map1 = new HashMap<>();
        HashMap<Integer, BigDecimal> map2 = new HashMap<>();
        for (int i = 1; i < 100; i++) {
            map1.put(i, Convert.toBigDecimal(i*2));
            map2.put(i,new BigDecimal(i));

        }

        map1.forEach((k,v)-> {
            map2.merge(k, v, (v1, v2) -> {
//
                return v2.divide(v1, 3, RoundingMode.FLOOR);
            });
        });
        map2.forEach((k,v)-> System.out.println(k+":::::"+v));
    }
}
